package com.qfjy.mapper;

import com.qfjy.entity.po.MeetingGrab;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface MeetingGrabMapper {
    int deleteByPrimaryKey(String id);

    int insert(MeetingGrab record);

    int insertSelective(MeetingGrab record);

    MeetingGrab selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(MeetingGrab record);

    int updateByPrimaryKey(MeetingGrab record);

    /**
     *  根据发单ID 查找抢单人用户信息
     *  会议发单- 我的发单列表（根据发单ID）-抢单者列表
     */
    List<MeetingGrab> selectGrabListByPid(String pid);

    /**
     * 就选你功能
     * 1、根据pid 状态全部改为grab_status=2
     * 其它抢单的人
     * update meeting_grab set grab_status=2,grab_date=NOW() where pid=''
     */
    @Update(" update meeting_grab set grab_status=2,grab_date=NOW() where pid=#{pid} ")
    int updateMeetingGrabMatchFail(String pid);
    @Update(" update meeting_grab set grab_status=1 ,grab_date=NOW() where pid=#{pid} and uid=#{uid} ")
    int updateMeetingGrabMatchSucc(String pid,int uid);
}